<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>表格所见即所得编辑</title>
    <style>
      html,
      body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
      }
      #markdown {
        margin-top: 5%;
        width: 70%;
        margin-left: auto;
        margin-right: auto;
      }
    </style>
    <link rel="stylesheet" type="text/css" href="../packages/cherry-markdown/dist/cherry-markdown.css" />
    <link rel="Shortcut Icon" href="./logo/favicon.ico" />
    <link rel="Shortcut Icon" href="../logo/favicon.ico" />
    <link rel="Bookmark" href="../logo/favicon.ico" />
  </head>

  <body>
    <div id="dom_mask" style="position: absolute; top: 40px; height: 20px; width: 100%"></div>
    <div id="markdown"></div>
    <script src="../packages/cherry-markdown/dist/cherry-markdown.js"></script>
    <script type="module">
      const response = await fetch('./assets/markdown/table.md');
      const tableMd = await response.text();
      const cherry = new Cherry({
        id: 'markdown',
        toolbars: {
          toolbar: ['bold', 'italic', 'strikethrough', '|', 'header', 'list', 'graph']
        },
        editor: {
          height: '70%'
        },
        value: tableMd,
      });
    </script>
  </body>
</html>
